<?php

namespace addons\shopro\controller;


class Feedback extends Base
{

    protected $noNeedLogin = ['type'];
    protected $noNeedRight = ['*'];


    public function type()
    {
        $this->success('反馈类型', array_values(\app\admin\model\FeedbackClassify::list()));
    }


    public function add() {
        $params = $this->request->post();
        // 表单验证
        if (empty($params['images'])) {
            $this->error('图片不能为空', null, -1);
        }
        // 表单验证
        $this->shoproValidate($params, get_class(), 'add');

        $this->success('反馈成功', \addons\shopro\model\Feedback::add($params));
    }

    public function list() {
        $params = $this->request->post();
        $this->success('反馈列表', \addons\shopro\model\Feedback::list($params));
    }

    public function my_list() {
        $params = $this->request->post();
        $this->success('反馈列表', \addons\shopro\model\Feedback::my_list($params));
    }

    public function detail()
    {
        $params = $this->request->get();
        $this->success('反馈详情', \addons\shopro\model\Feedback::detail($params));
    }

    public function edit() {
        $params = $this->request->post();

        $this->success('追加成功', \addons\shopro\model\Feedback::edit($params));
    }

}
